$('.nav').find('a').each(function() {
    if ($(this).attr('href').toLowerCase()===location.pathname.toLowerCase()) {
        $(this).parent().addClass('current');
    }
});

$('body')
.on('change','.version',function(){
    var version = this.options[this.selectedIndex].value;
    location.href = location.pathname.replace(/(\/[^/]+\/).*/,'$1' + version);
});
for(var i=0;i<navs.length;i++){
    var subs=navs[i];
    if (~subs.value.indexOf(location.pathname)) {
        $('[data-subs="'+subs.id+'"]').addClass('current');
        $('.submenus a').each(function() {
            if ($(this).attr('href').toLowerCase()===location.pathname.toLowerCase()) {
                $('.currentSlide').remove();
                $('<div class="currentSlide"></div>').insertBefore($(this));
                $('.currentSlide').width($('#aside').width());
            }
        });
        break;
    }
}
